# 递归函数案例
# 求n的阶乘
result = 1
n = int(input("请输入一个数字："))
while n > 1:
    result *= n
    n -= 1
print(result)

def diGui(n):
    if n > 1:
        return n * diGui(n - 1)
    else:
        return 1
print(diGui(5))

goodsList = [
    {"name":"可乐","price":"2.5"},
{"name":"红茶","price":"3.5"},
{"name":"绿茶","price":"3"},
]
# 搜索商品函数
def searchGoods(goodsName):
    for item in goodsList:
        if item["name"] == goodsName:
            return {"status": 200,"msg":"商品存在", "goodsName": goodsName}
    return {"status":400,"msg":"商品不存在"}
print(searchGoods("绿茶"))